package com.lx.zxs.controller;

import com.lx.zxs.entity.Video;
import com.lx.zxs.service.CommentService;
import com.lx.zxs.service.bVideoService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.CrossOrigin;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;
import java.util.Map;

@CrossOrigin
@RestController
@RequestMapping("/comment")
public class CommentController {

    @Autowired
    CommentService commentService;
    @RequestMapping("/getCommentByVideoId")
    public List<Map> getCommentByVideoId(Integer id) {

        return commentService.getCommentByVideoId(id);
    }

    @RequestMapping("/addComment")
    public void addComment(Integer uid,Integer vid,String content,String cdate) {
        commentService.addComment(uid,vid,content,cdate);
    }
}
